﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TKToXML.Models
{
    public class SinhVien
    {
        public virtual int Id { get; set; }              
        public virtual string Name { get; set; }        

        public virtual Lop Lop { get; set; }

        public override bool Equals(object obj)
        {
            if (obj.GetType() != typeof(SinhVien))
                return false;

            var other = obj as SinhVien;
            return Id == other.Id && Lop.Id == other.Lop.Id && Lop.Nam == other.Lop.Nam;                
        }

        public override int GetHashCode()
        {            
            int hash = 13;
            hash = (hash * 7) + Id.GetHashCode();
            hash = (hash * 7) + Lop.Id.GetHashCode();
            hash = (hash * 7) + Lop.Nam.GetHashCode();
            
            return hash;
        }
    }
}
